<?php


namespace backend\async;


use Faker\Generator;

class Gen
{
    public $isfirst = true;

    public $generator;

    public function __construct(Generator $generator)
    {
        $this->generator = $generator;
    }

    public function valid()
    {
        return $this->generator->valid();
    }


    public function send($value=null)
    {
        if ($this->isfirst){
            $this->isfirst = false;
            return $this->generator->current();
        }
    }
}